package com.ys.nms.module.business.dal.dataobject.devices;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ys.nms.framework.mybatis.core.dataobject.BaseSlaveDO;
import com.ys.nms.framework.tenant.core.aop.TenantIgnore;
import com.ys.nms.module.business.dal.dataobject.processors.ProcessorsDO;
import com.ys.nms.module.business.dal.dataobject.storage.StorageDO;
import lombok.*;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

/**
 * 设备 DO
 *
 * @author 超级管理员
 */
@TableName("devices")
@KeySequence("devices_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库，可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TenantIgnore
public class DevicesDO extends BaseSlaveDO {

    /**
     * device_id
     */
    @TableId
    @TableField(value = "device_id")
    @JSONField(name = "device_id")
    private Integer deviceId;

    @TableField("inserted")
    @JSONField(name = "inserted")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime inserted;

    @TableField("hostname")
    @JSONField(name = "hostname")
    private String hostname;

    @TableField("sysName")
    @JSONField(name = "sysName")
    private String sysName;

    @TableField("display")
    @JSONField(name = "display")
    private String display;

    @TableField("ip")
    @JSONField(name = "ip")
    private String ip;

    @TableField("overwrite_ip")
    @JSONField(name = "overwrite_ip")
    private String overwriteIp;

    @TableField("community")
    @JSONField(name = "community")
    private String community;

    @TableField("authlevel")
    @JSONField(name = "authlevel")
    private String authLevel;

    @TableField("authname")
    @JSONField(name = "authname")
    private String authName;

    @TableField("authpass")
    @JSONField(name = "authpass")
    private String authPass;

    @TableField("authalgo")
    @JSONField(name = "authalgo")
    private String authAlgo;

    @TableField("cryptopass")
    @JSONField(name = "cryptopass")
    private String cryptoPass;

    @TableField("cryptoalgo")
    @JSONField(name = "cryptoalgo")
    private String cryptoAlgo;


    @TableField("snmpver")
    @JSONField(name = "snmpver")
    private String snmpver;


    // 显式定义 getter/setter，并通过 @JsonProperty 指定 JSON 字段名
    @JSONField(name = "snmpver")
    public String getSnmpver() {
        return snmpver;
    }

    @JSONField(name = "snmpver")
    public void setSnmpver(String snmpver) {
        this.snmpver = snmpver;
    }

    @TableField("port")
    @JSONField(name = "port")
    private Integer port;

    @TableField("transport")
    @JSONField(name = "transport")
    private String transport;

    @TableField("timeout")
    @JSONField(name = "timeout")
    private Integer timeout;

    @TableField("retries")
    @JSONField(name = "retries")
    private Integer retries;

    @TableField("snmp_disable")
    @JSONField(name = "snmp_disable")
    private Integer snmpDisable;

    @TableField("bgpLocalAs")
    @JSONField(name = "bgpLocalAs")
    private Integer bgpLocalAs;

    @TableField("sysObjectID")
    @JSONField(name = "sysObjectID")
    private String sysObjectId;

    @TableField("sysDescr")
    @JSONField(name = "sysDescr")
    private String sysDescr;

    @TableField("sysContact")
    @JSONField(name = "sysContact")
    private String sysContact;

    @TableField("version")
    @JSONField(name = "version")
    private String version;

    @TableField("hardware")
    @JSONField(name = "hardware")
    private String hardware;

    @TableField("features")
    @JSONField(name = "features")
    private String features;

    @TableField("location_id")
    @JSONField(name = "location_id")
    private Integer locationId;

    @TableField("os")
    @JSONField(name = "os")
    private String os;

    @TableField("status")
    @JSONField(name = "status")
    private Integer status;

    @TableField("status_reason")
    @JSONField(name = "status_reason")
    private String statusReason;

    @TableField("`ignore`")
    @JSONField(name = "ignore")
    private Integer ignore;

    @TableField("disabled")
    @JSONField(name = "disabled")
    private Integer disabled;

    @TableField("uptime")
    @JSONField(name = "uptime")
    private Long uptime;

    @TableField("agent_uptime")
    @JSONField(name = "agent_uptime")
    private Integer agentUptime;

    @TableField("last_polled")
    @JSONField(name = "last_polled")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime lastPolled;

    @TableField("last_poll_attempted")
    @JSONField(name = "last_poll_attempted")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime lastPollAttempted;

    @TableField("last_polled_timetaken")
    @JSONField(name = "last_polled_timetaken")
    private Double lastPolledTimetaken;

    @TableField("last_discovered_timetaken")
    @JSONField(name = "last_discovered_timetaken")
    private Double lastDiscoveredTimetaken;

    @TableField("last_discovered")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(name = "last_discovered")
    private LocalDateTime lastDiscovered;

    @TableField("last_ping")
    @JSONField(name = "last_ping")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime lastPing;

    @TableField("last_ping_timetaken")
    @JSONField(name = "last_ping_timetaken")
    private Double lastPingTimetaken;

    @TableField("purpose")
    @JSONField(name = "purpose")
    private String purpose;

    @TableField("type")
    @JSONField(name = "type")
    private String type;

    @TableField("serial")
    @JSONField(name = "serial")
    private String serial;

    @TableField("icon")
    @JSONField(name = "icon")
    private String icon;

    @TableField("poller_group")
    @JSONField(name = "poller_group")
    private Integer pollerGroup;

    @TableField("override_sysLocation")
    @JSONField(name = "override_sysLocation")
    private Integer overrideSysLocation;

    @TableField("notes")
    @JSONField(name = "notes")
    private String notes;

    @TableField("port_association_mode")
    @JSONField(name = "port_association_mode")
    private Integer portAssociationMode;

    @TableField("max_depth")
    @JSONField(name = "max_depth")
    private Integer maxDepth;

    @TableField("disable_notify")
    @JSONField(name = "disable_notify")
    private Integer disableNotify;

    @TableField("ignore_status")
    @JSONField(name = "ignore_status")
    private Integer ignoreStatus;

    @TableField("quyu")
    @JSONField(name = "quyu")
    private Integer quyu;

    @TableField("quyusub")
    @JSONField(name = "quyusub")
    private Integer quyusub;

    @TableField("tag1")
    @JSONField(name = "tag1")
    private String tag1;

    @TableField("tag2")
    @JSONField(name = "tag2")
    private String tag2;

    @TableField("tag3")
    @JSONField(name = "tag3")
    private String tag3;

    @TableField("tag4")
    @JSONField(name = "tag4")
    private String tag4;

    @TableField("tag5")
    @JSONField(name = "tag5")
    private String tag5;

    @TableField("tag6")
    @JSONField(name = "tag6")
    private String tag6;

    @TableField("tag7")
    @JSONField(name = "tag7")
    private String tag7;

    @TableField("tag8")
    @JSONField(name = "tag8")
    private String tag8;

    @TableField("tag9")
    @JSONField(name = "tag9")
    private String tag9;

    @TableField("tag10")
    @JSONField(name = "tag10")
    private String tag10;

    @TableField("tag11")
    @JSONField(name = "tag11")
    private String tag11;

    @TableField("tag12")
    @JSONField(name = "tag12")
    private String tag12;

    @TableField("tag13")
    @JSONField(name = "tag13")
    private String tag13;

    @TableField("xianlu")
    @JSONField(name = "xianlu")
    private String xianlu;

    @TableField("snmpyes")
    @JSONField(name = "snmpyes")
    private String snmpYes;

    @TableField("type_name")
    @JSONField(name = "type_name")
    private String typeName;

    @TableField("x")
    @JSONField(name = "x")
    private BigDecimal x;

    @TableField("y")
    @JSONField(name = "y")
    private BigDecimal y;

    @TableField(exist = false)
    List<ProcessorsDO> processorsDOList;

    @TableField(exist = false)
    List<StorageDO> storageDOList;

    @TableField(exist = false)
    private Map<String, Object> extra;


    //是否开启了SNMP  1是2否
    @TableField(exist = false)
    private boolean showMore;



}
